<?php
	class moduleControl extends commonControl{
		function index(){
			$db = M();
			$dbinfo = $db->get_table_info();
			$this->assign("dbinfo",$dbinfo["table"]);
			$this->display();
		}	
		//开始备份；
		function startbak(){
			$table = isset($_POST["table"]) ? $_POST["table"] : "";   //得到要删除的表名；
			$db = new backup($table,'',__CONTROL__.'/index',0,3);
			if($db->backup()){
				$this->success("备份成功","index");
			}else{
				$this->error("备份失败","index");
			}
		}
		//显示备份数据页；
		function showbak(){
			$dirs = dir::tree(C("DB_BACKUP"));
			$this->assign("dirs",$dirs);
			$this->display();
		}
		//删除数据；
		function del(){
			$dir = rtrim(C("DB_BACKUP"),'/').'/'.$_GET["name"];
			if(dir::del($dir)){
				$this->success("删除目录成功","showbak");
			}else{
				$this->error("删除目录失败","showbak");
			}
		}
		//还原数据；
		function recovery(){
			$dir = $_GET['name'];
			$db = new backup("",$dir,__CONTROL__.'/showbak',0,2);
			$db->recovery();
		}

	}
?>